Show the code
import pandas as pd
import numpy as np
from lets_plot import *
LetsPlot.setup_html(isolated_frame=True)import pandas as pd
import numpy as np
from lets_plot import *
LetsPlot.setup_html(isolated_frame=True)# Learn morea about Code Cells: https://quarto.org/docs/reference/cells/cells-jupyter.html
# Include and execute your code here
df = pd.read_csv("https://github.com/byuidatascience/data4names/raw/master/data-raw/names_year/names_year.csv")How does your name at your birth year compare to its use historically? Your must provide a chart. The years labels on your charts should not include a comma.
Historically, My name became very popular around the mid 50s, then dipped, become popular again in the mid 80s. My name has dipped again, but remains relativily popular with thousands of Daniels each year.
# Q1
data=df.query("name == ['Daniel']")
ggplot(data=data, mapping=aes(x='year',y='Total')) + geom_bar(stat='identity')+scale_x_continuous(limits=[1920,2015],format='d')+geom_vline(xintercept=2003,linetype=5,color='red')+geom_text(x=2002,y=20000,label= "My birth year")If you talked to someone named Brittany on the phone, what is your guess of his or her age? What ages would you not guess? Try to justify your answer with whatever statistics knowledge you have. You must provide a chart. The years labels on your charts should not include a comma.
I would think they would be between 18-45 years old with the most likely age being 35 because there was a huge peak in 1990, and there were less than 1000 Brittanys born each year before 1980 and after 2007
# Q2
data=df.query("name == ['Brittany']")
ggplot(data=data, mapping=aes(x='year',y='Total')) + geom_bar(stat='identity')+scale_x_continuous(limits=[1920,2015],format='d')+geom_vline(xintercept=1980,linetype=5,color='red')+geom_text(x=1981,y=20000,label= "More than 1000 Britanys",angle=90)+geom_vline(xintercept=2007,linetype=5,color='red')+geom_text(x=2006,y=20000,label= "Less than 1000 Britanys",angle=90)